﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XMLSpreadGear.Core;

namespace XMLSpreadGear.Headers
{
   public class Interior:BaseElement
    {
        private string m_Color;
        private string m_PatternColor;
        private InteriorPattern m_Pattern = InteriorPattern.None;


        public Interior()
            : base(LocalNames.INTERIOR)
        {

        }

        public Interior(InteriorPattern interiorPattern, string color, string paternColor)
            : this()
        {
            this.Color = color;
            this.Pattern = interiorPattern;
            this.PatternColor = paternColor;
          
        }

        


        public string Color
        {
            get { return m_Color; }
            set { m_Color = value; }
        }
        
        public InteriorPattern Pattern
        {
            get { return m_Pattern; }
            set { m_Pattern = value; }
        }
       
        public string PatternColor
        {
            get { return m_PatternColor; }
            set { m_PatternColor = value; }
        }

        internal protected override IDictionary<string, string> RegisterAttributes()
        {
            IDictionary<string, string> dic = new Dictionary<string, string>();
            if(this.Pattern != null)
                dic.Add("Pattern", Enum.GetName(typeof(InteriorPattern), this.Pattern));

            if(!string.IsNullOrEmpty(this.Color))
                dic.Add("Color", this.Color);

            if(this.PatternColor != null)
                dic.Add("PatternColor",this.PatternColor.ToString());

            return dic;
        }

        internal protected override IDictionary<string, string> RegisterElements()
        {
            IDictionary<string, string> dic = new Dictionary<string, string>();
            return dic;
        }


        protected override void SetDefaults()
        {
            return;
        }

        internal override string GetAttributeNamespace()
        {
            return Contstants.SpredsheetAttributePrefix;
        }

        internal override string GetAttributeNamespaceURI()
        {
            return Contstants.SpredsheetAttributeNamespace;
        }
    }
}
